package Basic.day02;

public class IntDemo {
    public static void main(String[] args) {
        // 整数类型
        // byte: 1 字节 -128~127
        // short: 2 字节 -32768~32767
        // int: 4 字节 -2147483648~2147483647
        // long: 8 字节 -9223372036854775808~9223372036854775807
        // 默认类型: int
        int a = 10;
        int b = 3;
        System.out.println("a/b = " + a/b);

        System.out.println(5.0/2);

        final int MAX_INT = Integer.MAX_VALUE;  //MAX_INT = 2147483647
        System.out.println(MAX_INT);
        System.out.println(MAX_INT + 1);  //Out: -2147483648
        System.out.println(MAX_INT + 2);  //Out: -2147483647
        System.out.println(MAX_INT + 3);  //Out: -2147483646
        System.out.println(MAX_INT + 4);  //Out: -2147483645
        System.out.println(MAX_INT + 5);  //Out: -2147483644
        System.out.println(MAX_INT + 6);  //Out: -2147483643
        System.out.println(MAX_INT + 7);  //Out: -2147483642
        System.out.println(MAX_INT + 8);  //Out: -2147483641
    }
}

